/**
 * 审计日志操作类型
 */
export const AUDIT_LOG_OPERATION_TYPE = {
  /** 查询 */
  QUERY: 1,
  /** 新增 */
  CREATE: 2,
  /** 修改 */
  UPDATE: 3,
  /** 删除 */
  DELETE: 4,
  /** 导出 */
  EXPORT: 5,
  /** 导入 */
  IMPORT: 6,
  /** 登录 */
  LOGIN: 7,
  /** 登出 */
  LOGOUT: 8,
  /** 其他 */
  OTHER: 9,
} as const;

/**
 * 审计日志操作类型
 */
export type AuditLogOperationType = (typeof AUDIT_LOG_OPERATION_TYPE)[keyof typeof AUDIT_LOG_OPERATION_TYPE];

/**
 * 审计日志操作类型标签
 */
export const AUDIT_LOG_OPERATION_TYPE_LABELS: Record<AuditLogOperationType, string> = {
  [AUDIT_LOG_OPERATION_TYPE.QUERY]: '查询',
  [AUDIT_LOG_OPERATION_TYPE.CREATE]: '新增',
  [AUDIT_LOG_OPERATION_TYPE.UPDATE]: '修改',
  [AUDIT_LOG_OPERATION_TYPE.DELETE]: '删除',
  [AUDIT_LOG_OPERATION_TYPE.EXPORT]: '导出',
  [AUDIT_LOG_OPERATION_TYPE.IMPORT]: '导入',
  [AUDIT_LOG_OPERATION_TYPE.LOGIN]: '登录',
  [AUDIT_LOG_OPERATION_TYPE.LOGOUT]: '登出',
  [AUDIT_LOG_OPERATION_TYPE.OTHER]: '其他',
};

/**
 * 审计日志操作类型颜色
 */
export const AUDIT_LOG_OPERATION_TYPE_COLORS: Record<AuditLogOperationType, string> = {
  [AUDIT_LOG_OPERATION_TYPE.QUERY]: 'blue',
  [AUDIT_LOG_OPERATION_TYPE.CREATE]: 'green',
  [AUDIT_LOG_OPERATION_TYPE.UPDATE]: 'orange',
  [AUDIT_LOG_OPERATION_TYPE.DELETE]: 'red',
  [AUDIT_LOG_OPERATION_TYPE.EXPORT]: 'purple',
  [AUDIT_LOG_OPERATION_TYPE.IMPORT]: 'purple',
  [AUDIT_LOG_OPERATION_TYPE.LOGIN]: 'cyan',
  [AUDIT_LOG_OPERATION_TYPE.LOGOUT]: 'default',
  [AUDIT_LOG_OPERATION_TYPE.OTHER]: 'default',
};

